﻿<Window x:Class="Gao.Poker.App.Game.SelectTemplateWin"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="400" Width="350" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" WindowStyle="None"
        Name="window" ShowInTaskbar="False">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="5" HorizontalAlignment="Center">
            <TextBlock Text="比赛名称：" Margin="10,5,0,5"  VerticalAlignment="Center"/>
            <TextBox Text="{Binding CompetitionName}" Width="150" Margin="0,5,0,5" VerticalContentAlignment="Center"/>
            <Button Margin="10,5,5,5" Width="45" Style="{DynamicResource Orrange}" Content="查询" Command="{Binding SearchCommand}" />
        </StackPanel>
        <DataGrid Grid.Row="1" Margin="1,1,1.2,1" VerticalAlignment="Top" RowHeight="30" AutoGenerateColumns="False" IsReadOnly="True"
                      SelectionMode="Single"  CanUserAddRows="True" CanUserResizeColumns="False" CanUserResizeRows="False"
                      ItemsSource="{Binding Path=Competitions}" SelectedItem="{Binding Path=Competition}"
                      FontSize="16" Name="dgCompetition" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="比赛名称" Width="*" Binding="{Binding Path=Name}"/>
            </DataGrid.Columns>
        </DataGrid>

        <StackPanel Orientation="Horizontal"  Grid.Row="3" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Center">
            <Button Padding="5" Style="{DynamicResource Orrange}" Width="60" FontSize="16" Height="35" Command="{Binding SubmitCommand}" CommandParameter="{Binding ElementName=window}">确定</Button>
            <Button Padding="5" Style="{DynamicResource Orrange}" Width="60" FontSize="16" Height="35" Command="{Binding CloseCommand}" CommandParameter="{Binding ElementName=window}">取消</Button>
        </StackPanel>
    </Grid>
</Window>
